<!DOCTYPE html>
<!-- Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->
<html>
  <head>
    <title>Detecting Google Chrome Frame</title>
    <link rel="stylesheet" type="text/css" href="/css/cselement.css"/>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('chrome-frame', '1');

      function notNeeded() {
        var answerDiv = document.getElementById('answer');
        answerDiv.innerHTML = 'Oh it looks like maybe you don\'t need Google Chrome Frame.';
      }

      function onLoad() {
        // Wait .25 seconds for CFInstall.check.
        var browserCheck = setTimeout("notNeeded();", 250);
        
        function missing() {
          var answerDiv = document.getElementById('answer');
          answerDiv.innerHTML = 'Oh, sorry, it is not installed.';
          if (browserCheck != null) {
            clearTimeout(browserCheck);
          }
        }

        function found() {
          var answerDiv = document.getElementById('answer');
          answerDiv.innerHTML = 'Hooray! You have Google Chrome Frame installed.';
          if (browserCheck != null) {
            clearTimeout(browserCheck);
          }
        }

        if (CFInstall.isAvailable()) {
          found();
        }

        // Check to see if Google Chrome Frame is installed and display a message to
        // the user.
        CFInstall.check({
            'onmissing': missing,
            'preventPrompt': true
          });
      }

      google.setOnLoadCallback(onLoad);
    </script>
  </head>
  <body style="padding: 50px;">
    Do you have Google Chrome Frame installed?
    <div id="answer">We're checking on that now.</div>
  </body>
</html>
